home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 154_01 / getkey.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-01  |  256 b   |  13 lines

  1. /* getkey.c:    single, unbuffered keypress via BIOS */
  2.  
  3. #include <dos.h>
  4.  
  5. char getkey()
  6. {
  7.     struct reg regs;
  8.  
  9.     regs.r_ax = 0;
  10.     intcall(®s,®s,0x16);
  11.     return((char) regs.r_ax & 0x00ff);  /* answer in AL */
  12. }
  13.